#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	double x;
	cin >> x;
	double ans = 0;
	if (x <= 180)
		ans = x * 0.565;
	else if (x <= 350)
		ans = 180 * 0.565 + (x - 180) * 0.615;
	else
		ans = 180 * 0.565 + 170 * 0.615 + (x - 350) * 0.865;
	cout << fixed << setprecision(2) << ans;
	return 0;
}
